/*
 * CAppStateStage.h
 *
 *  Created on: 26/12/2012
 *
 */

#ifndef CAPPSTATESTAGE_H_
#define CAPPSTATESTAGE_H_
#include "CAppState.h"
#include "CSurface.h"
#include <SDL/SDL_net.h>
#include "CNet.h"
#include <SDL/SDL_ttf.h>
#include "CAppState.h"
#include "DataLoader.h"


class CAppStateStage : public CAppState {
	private:
    	static CAppStateStage instance;
		SDL_Color color;
		TTF_Font* font;
		CNetMessage msg;
		SDL_Surface* surface;
		SDL_Surface* userNickSurface;
		SDL_Surface* userNick2Surface;
		SDL_Surface* okSurface;
		bool ready;
		bool otherPlayerReady;
		DataLoader user;
	public:
		CAppStateStage();

	public:
        void onActivate();

        void onDeactivate();

        void onLoop();

        void onRender(SDL_Surface* surfDisplay);

        void onLButtonDown(int mX, int mY);

        static CAppStateStage* getInstance();

        void setUser(DataLoader& user){this->user = user;};
	private:
        void loadOkButtonSurface();

};

#endif /* CAPPSTATESTAGE_H_ */
